package com.hnhcyy.goods.service;

import com.hnhcyy.goods.pojo.Goods;
import com.hnhcyy.goods.pojo.GoodsQueryParam;
import com.hnhcyy.goods.pojo.SpMchk;
import com.hnhcyy.goods.pojo.SpOldMchk;

import java.util.List;

/**
 * @author sheyongjun
 * @Date 2019/4/13 下午 2:08
 */
public interface EsGoodsService {

    /**
     * @Description:    保存商品数据
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/13 下午 2:09
     * @Version:        1.0
     */
    String saveGoods(Goods goods);

    /**
     * @Description:    批量保存goods
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/13 下午 2:43
     * @Version:        1.0
     */
    String bulkSaveGoods(List<Goods> goodsList);
    
    /**
     * @Description:    批量保存sp_mchk
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/17 下午 4:43
     * @Version:        1.0
     */
    String bulkSaveSpMchk(List<SpMchk> spMchkList);

    /**
     * @Description:    批量保存sp_old_mchk
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/19 下午 2:30
     * @Version:        1.0
     */
    String bulkSaveSpOldMchk(List<SpOldMchk> spOldMchkList);

    /**
     * @Description:    搜索
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/13 下午 2:09
     * @Version:        1.0
     */
    List<Goods> list(GoodsQueryParam goodsQueryParam);

    /**
     * @Description:    判断文档是否存在
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/16 上午 10:05
     * @Version:        1.0
     */
    boolean exists(String type, String  id);

    /**
     * @Description:    更新数据
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/16 上午 10:42
     * @Version:        1.0
     */
    int updateGoods(String id, Goods goods);

    /**
     * @Description:    删除数据(OK:200, NOT_FOUND:404 )
     * @Author:         sheyongjun
     * @CreateDate:     2019/4/16 上午 10:16
     * @Version:        1.0
     */
    int delete(String type, String id);
}
